<template>
  <input :type="type" class="minput" :value="modelValue" @input="updateValue" :placeholder="placeholder"
    :disabled="disabled" />
</template>

<script>
export default {
  name: 'MInput',
  props: {
    modelValue: {
      type: [String, Number],
    },
    type: {
      type: String,
    },
    placeholder: {
      type: [String],
    },
    disabled: {
      type: Boolean,
      default: false,
    }

  },
  emits: ['update:modelValue'],
  setup(props, { emit }) {
    const updateValue = (event) => {
      emit('update:modelValue', event.target.value);
    };

    return {
      updateValue
    };
  }
};
</script>

<style scoped>
.minput {
  height: 26px;
  border: 1px solid #d2d2d2;
  border-radius: 4px;
  box-sizing: border-box;
  padding: 0 5px;
}
</style>
